import java.util.Scanner;

public class Demo12 {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        System.out.println("请输入Java文件名：");
        String javaFile=sc.nextLine();
        System.out.println("请输入邮箱地址：");
        String email =sc.next();
        boolean fileCorrect =false;
        boolean emailCorrect =false;

        if(javaFile.endsWith(".java")){
            fileCorrect = true;
        }else {
            System.out.println("java文件格式错误");
        }
        if(email.indexOf("@")!= -1 &&email.indexOf(".") >email.indexOf("@")){
            emailCorrect = true;
        }else{
            System.out.println("邮箱地址有误");
        }

        if(fileCorrect && emailCorrect ){
            System.out.println("作业提交成功");
        }else {
            System.out.println("提交失败，请简述格式");
        }
    }
}
